#import "ALSourceListAppTitleTextFieldCell.h"
#import "NSShadow+MCAdditions.h"

static NSDictionary *ALSourceListAppTitleTextFieldCellSelectedAttributes;
static NSDictionary *ALSourceListAppTitleTextFieldCellUnselectedAttributes;

@implementation ALSourceListAppTitleTextFieldCell

+(void)initialize {
	CGFloat fontSize = [NSFont systemFontSize];
	NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
	[paragraphStyle setAlignment:NSLeftTextAlignment];
	[paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
	NSShadow *textShadow = [[NSShadow alloc] mcInitWithColor:[NSColor colorWithCalibratedWhite:0.0f alpha:0.5f] offset:NSMakeSize(0, -1) blurRadius:1];
	ALSourceListAppTitleTextFieldCellSelectedAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont boldSystemFontOfSize:fontSize], NSFontAttributeName, [NSColor whiteColor], NSForegroundColorAttributeName, textShadow, NSShadowAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil];
	ALSourceListAppTitleTextFieldCellUnselectedAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:fontSize], NSFontAttributeName, [NSColor blackColor], NSForegroundColorAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil];
}

-(NSDictionary *)normalAttributes {
	NSDictionary *attributes = [[NSDictionary alloc] initWithDictionary:ALSourceListAppTitleTextFieldCellUnselectedAttributes copyItems:YES];
	return attributes;
}

-(NSDictionary *)highlightedAttributes {
	NSDictionary *attributes = [[NSDictionary alloc] initWithDictionary:ALSourceListAppTitleTextFieldCellSelectedAttributes copyItems:YES];
	return attributes;
}

@end
